<template>
	<view class="vip-cards-item">
		<view class="cards-img">
			<image src="" mode="aspectFill"></image>
			<text>{{ item.type == 1? '周卡' : '月卡'}}</text>
		</view>
		<view class="cards-info">
			<view class="cards-name">
				<!-- {{ item.title }} -->
				12121
			</view>
			<view class="cards-price-num">
				<view class="cards-price">
					<!-- ￥{{ item.price }} -->
					0009
				</view>
				<view class="cards-num" v-if="item.stock != -1">
					库存<text class="green">{{ item.stock }}</text>张
				</view>
			</view>
		</view>
		<!-- 购买 -->
		<view class="buying-btn" @click="goDetail(item)">
			<text>购买</text>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				
			}
		},
		props: {
			currentTab: [String, Number],
			item: [Object, String, Number]
		},
		methods: {
			goDetail(item){
				let cardsInfo = {
					description: item.description,
					title: item.title,
					price: item.price,
					type: item.type,
					id: item.id
				};
				uni.navigateTo({
					url: '/plugins/member-benefits/cards-detail/cards-detail?cardsInfo='+ encodeURIComponent(JSON.stringify(cardsInfo))
				})
			}
		}
	}
</script>

<style scoped lang="scss">
@import './index.scss';
</style>